1. Set Variant

Method    : POST
Syntax    : {host}:{port}/_admin/api/route/{routeId}
Rest API  : curl -H "Content-Type: application/json" -X POST -d '{"variant":"preorder"}' http://localhost:8000/_admin/api/route/getCollection?returnConfig=true
midway.route({
    id: 'getCollection',
    label: 'Get Collection',
    path: '/product/grouping/api/collection/{collectionId}',
 
    variantLabel: 'default',
    handler: function(req, reply) {
        var response = getResponseData('/product/grouping/api/collection', 'default');
        reply(response);
    }
})
.variant({
    id: 'preorder',
    label: 'Get Pre-order Collection',
    handler: function (req, reply) {
        reply({message: 'hello pre-order'});
    }
});

To get the config back as a response, add query parameter returnConfig=true as shown in example above

2. Set Mock Id

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/setMockId/{mockid}/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/setMockId/1234/default

3. Get Mock Id

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/getMockId/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/getMockId/default

4. Reset Mock Id

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/resetMockId/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/resetMockId/default

5. Get Url Count

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/getURLCount/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/getURLCount/default

6. Reset Url Count

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/resetURLCount/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/resetURLCount/default

7. Re-set the state of Mock Server

Method    : POST
Syntax    : {host}:{port}/_admin/api/state/reset
Rest API  : curl -X POST http://localhost:8000/_admin/api/state/reset

8. Register Session

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/registerSession
Rest API  : curl http://localhost:8000/_admin/api/midway/registerSession

9. Get Sessions

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/getSessions
Rest API  : curl http://localhost:8000/_admin/api/midway/getSessions

10. Check Session

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/checkSession/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/checkSession/{sessionid}

11. Close Session

Method    : GET
Syntax    : {host}:{port}/_admin/api/midway/closeSession/{sessionid}
Rest API  : curl http://localhost:8000/_admin/api/midway/closeSession/{sessionid}